<p>One thing that makes good code good is the clarity with which it conveys the intent of the original programmer to maintainers, and the proper
choice of <code>indexOf</code> methods can help move code from confusing to clear.</p>
<p>If you need to see whether a substring is located beyond a certain point in a string, you can test the <code>indexOf</code> the substring versus
the target point, or you can use the version of <code>indexOf</code> which takes a starting point argument. The latter is arguably clearer because the
result is tested against -1, which is an easily recognizable "not found" indicator.</p>
<h2>Noncompliant Code Example</h2>
<pre>
String name = "ismael";

if (name.indexOf("ae") &gt; 2) { // Noncompliant
  // ...
}
</pre>
<h2>Compliant Solution</h2>
<pre>
String name = "ismael";

if (name.indexOf("ae", 2) &gt; -1) {
  // ...
}
</pre>

